<?php
require('chinese-unicode.php'); 
$pdf=new PDF_Unicode();  

$pdf->AddUniCNShwFont('uni'); 
$pdf->AddUniGBhwFont('uGB');

//initialize document
$pdf->AliasNbPages();

$first=$_POST['first_name'];
$last= $_POST['last_name'];
$cname=$_POST['cname'];
//$cname = iconv("UTF-8","cp874",$text); 
$my_t=getdate(date("U"));
$head1 ="$my_t[month] $my_t[mday], $my_t[year]";
$head2='Dear Sir/Madam,';
$html1 = "<u>2009 Summer Conference Registration Confirmation Letter</u>";
$html2 = "This is to confirm that $first $last ($cname) has registered ";
$html2b="Conference.";
$html3 = "The conference will be held at Hyatt Regency San Francisco Airport, from 7/2-7/6.";
$html4 = "The purpose of this conference is to draw people near to our Lord Jesus Christ.";
$html5 = "Forerunner Mission Ministry is a non-profit organization. This conference is an";
$html6 = "annual meeting for people all over the world to worship the Lord. And it is open";
$html6b= "to the public."; 
$html7 = "Please don't hesitate to contact us for any questions regarding this conference.";
$html8 = "Sincerely,";
$html9 = "Forerunner Mission Ministry";
$html10 = "__________________________________________________________________________________";

//$pdf=new PDF();

//initialize document
$pdf->AliasNbPages();

//First page
$pdf->AddPage();

    $pdf->Ln(20);

    $pdf->SetFont('uni','B',14);
    //Move to the right
    $pdf->Cell(10);
    //Framed title
	$pdf->Write(5,'Forerunner Mission Ministry');
	$pdf->SetFont('uni','',12);
	$pdf->Ln(5);
    $pdf->Cell(10);		
	$pdf->Write(5,'39610 Sundale Drive, Fremont, CA 94538');
	$pdf->Ln(5);
    $pdf->Cell(10);	
	$pdf->Write(5,'Tel: (510)656-8900  Fax: (510)656-8989');
	$pdf->Ln(5);
    $pdf->Cell(10);	
	$pdf->Write(5,'http://www.forerunner.cc');
	//Line break
	$pdf->Ln(25);

//$pdf->Image('frcc.jpg',10,12,30,0,'','http://forerunner.cc');

$pdf->SetLeftMargin(0);
$pdf->Cell(11);
$pdf->WriteHTML($head1);
$pdf->Ln(15);
$pdf->Cell(11);
$pdf->SetFont('uni','',12);
$pdf->Cell(10);
$pdf->WriteHTML($head2);
$pdf->SetFont('uni','B',14);
$pdf->Ln(13);
$pdf->Cell(21);
$pdf->WriteHTML($html1);

//$pdf->SetFont('uGB','',12);
//$pdf->Ln(15);
//$pdf->Cell(21);
//$pdf->WriteHTML($html2);
//$pdf->SetFont('uni','',12);
$pdf->Ln(5);
$pdf->SetFont('uni','',12);
$pdf->Cell(20);
$pdf->subWrite(10,"This is to confirm $first $last ",'',12);
if ($cname <>"") {
$pdf->SetFont('uGB','',12);
$pdf->Write(10,"($cname) ");
$pdf->SetFont('uni','',12);
$pdf->Write(10,"has registered for 2009 Summer");
$pdf->Ln(8);
$pdf->Cell(21);
$pdf->WriteHTML($html2b);
$pdf->Ln(5);
} else {
$pdf->Write(10,"has registered for 2009 Summer Conference."); 
$pdf->Ln(12);
}
$pdf->SetX(100);
$pdf->Ln(1);


$pdf->Cell(21);
$pdf->WriteHTML($html3);
$pdf->Ln(1);
$pdf->Cell(21);
$pdf->WriteHTML($html4);
$pdf->Ln(5);
$pdf->Cell(21);
$pdf->WriteHTML($html5);
$pdf->Ln(1);
$pdf->Cell(21);
$pdf->WriteHTML($html6);
$pdf->Ln(1);
$pdf->Cell(21);
$pdf->WriteHTML($html6b);
$pdf->Ln(5);
$pdf->Cell(21);
$pdf->WriteHTML($html7);
$pdf->Ln(30);
$pdf->Cell(21);
$pdf->WriteHTML($html8);
$pdf->Ln(5);
$pdf->Cell(21);
$pdf->WriteHTML($html9);

// footer
$pdf->Ln(2);
	//Select Arial bold 15
    $pdf->SetFont('uni','B',12);
    //Move to the right
    $pdf->Cell(20);
    //Framed title
	$pdf->Write(5,'_____________________________________________________________________________');
	$pdf->SetFont('uni','',12);	
	$pdf->Ln(5);
    $pdf->Cell(20);
    //Framed title
	$pdf->Write(5,'Hyatt Regency San Francisco Airport');
	$pdf->Ln(5);
    $pdf->Cell(20);		
	$pdf->Write(5,'1333 Bayshore Highway, Burlingame, CA 94010');
	$pdf->Ln(5);
    $pdf->Cell(20);	
	$pdf->Write(5,'http://www.sanfrancisco.hyatt.com');
	//Line break
	$pdf->Ln(15);

$pdf->Output();

?>